
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>用户选择框</title>
	<script src="../js/jquery-1.8.3.js"></script>
	
	<link rel="stylesheet" href="../css/other/main.css" type="text/css">
	<script type="text/javascript" src="../js/other/jquery.artDialog.source.js?skin=aero"></script>
	<script type="text/javascript" src="../js/other/iframeTools.source.js"></script>
	<script type="text/javascript" src="../js/other/jquery-framedialog.js"></script>
	<script src="../js/other/obpm-jquery-bridge.js"></script>

	<script src="../js/other/list.js"></script>
	<!-- tree pugin -->
	<script type="text/javascript" src="../js/other/jquery.cookie.js"></script>
	<script type="text/javascript" src="../js/other/jquery.hotkeys.js"></script>
	<script type="text/javascript" src="../js/other/jquery.jstree.js"></script>
	<script type="text/javascript" src="../js/other/jquery.jstree.checkbox.js"></script>
	<script type="text/javascript" src="../js/other/json2.js"></script>
	<script type="text/javascript" src="../js/other/jquery.slimscroll.min.js"></script>
	<script type="text/javascript">
		var contextPath='/qms';
		var domainid='3CffNlgt9B9StIjIUPB';
		var applicationid='null';
		var depttree;
		var args = OBPM.dialog.getArgs();
		var parentObj = args['parentObj'];
		/*存放userid*/
		var targetid=args['targetid'];
		/*存放username*/
		var viewName=args['receivername'];
		// 默认值
		var defValue=args['defValue'];
		var rolelist;
		/*选择模式*/
		var selectMode = args['selectMode'];
		/*存放userEmail*/
		var viewEmail=args['receiverEmail'];
		/*存放userEmailAccount*/
		var viewEmailAccount=args['receiverEmailAccount'];
		/*存放userTelephone*/
		var viewTelephone=args['receiverTelephone'];
		var qmsAppId = "__XelBa3DfXZSIOazulYu";
		function getOnLineUserList(){
			jQuery("#lefthead").html("当前在线用户:");
			jQuery.ajax({
				url:contextPath+"/qm/getOnLineUserList.action"+"?selectMode="+selectMode,
				type:"post",
				datatype:"json",
				data:{"domain":domainid},
				success:function(data){
					if(data){
						jQuery("#leftcontent").html(data);
						if(jQuery("#onLineUsersCount")){
							jQuery("#lefthead").html(jQuery("#lefthead").html()+"(<span style='color:red'>"+jQuery("#onLineUsersCount").attr("value")+"</span>)");
						}
					}else{
						jQuery("#leftcontent").html("<div class='list_div'>找不到用户</div>");
					}
				},
				error:function(data,status){
					alert("failling to visited...");
				}
			});

		}


		/*查找所有的用户*/
		function getAllUser(param){
			jQuery("#righttitle").html("<span style='float:left;'>按用户名称:</span><input type='text' placeholder='按用户名称' style='float:left;width:280px;height: 36px;outline:medium;border:none;background-color: #fafafa;' id='SHvalue' name='SHvalue' value=''><input onclick='getOnChange2Search(jQuery(\"#SHvalue\").attr(\"value\"))' type='button'  class='searchPerson'>");
			if(domainid!=""){
				jQuery.ajax({
					url: "/obpm/api/runtime/users/selectbox/contacts?contactsId=all",
					// url:contextPath+"/qm/getAllUser.action"+"?selectMode="+selectMode,
					type:"get",
					success:function(data){
						var userData = data.data.datas
						if(userData.length>0){
							var html = "";
							for(var i=0;i<userData.length;i++){
								html += '<div class="list_div" title="'+userData[i].name+'"><input class="list_div_click" type="checkbox" name="'+userData[i].name+'" id="'+userData[i].id+'" avatar="" email="" emailaccount="" telephone="'+userData[i].mobile+'" onclick="selectUser(jQuery(this),true)"><span onclick="jQuery(this).prev().click();selectUser(jQuery(this).prev(),true);">'+userData[i].name+'</span></div>'
							}
							jQuery("#SHvalue").attr("value",param);
							jQuery("#leftcontent").html("");
							jQuery("#rightcontent").html(html);
						}else{
							jQuery("#SHvalue").attr("value",param);
							//jQuery("#rightcontent").html("<div class='list_div'>找不到用户</div>");
							jQuery("#leftcontent").html("<div class='list_div'>找不到用户</div>");
						}
					},
					error:function(data,status){
						alert("failling to visited...");
					}
				});
			}
		}

		function getOnChange2Search(value){
			//jQuery("#righttitle").html("{*[Search]*}{*[Result]*}:");
			//if(value!=""){
			getAllUser(value);
			//}
		}

		/*根据角色id去那下面的users*/
		function getUserListByRole(obj){
			jQuery(".selectImg_right").each(function(){
				jQuery(this).css("visibility","hidden");
			});
			// jQuery("#img_"+obj.attr("id")).css("visibility","visible");
			getUserListByRoleid(obj);
		}

		function getUserListByRoleid(roleObj){
			var rolesid=roleObj.attr("id");
			var rolesname=roleObj.attr("title");
			if(rolesid!=""){
				jQuery("#righttitle").html("角色："+rolesname);
				jQuery.ajax({
					// url:contextPath+"/qm/getUserListByRole.action"+"?selectMode="+selectMode,
					url: "/obpm/api/runtime/"+qmsAppId+"/users/selectbox/role?roleId="+rolesid+"&type=0&pageSize=10&pageNum=1",
					type:"get",
					success:function(data){
						var userData = data.data.datas;
						if(userData.length>0){
							var html = "";
							for(var i=0;i<userData.length;i++){
								html+= '<div class="list_div" title="'+userData[i].name+'"><input class="list_div_click" type="checkbox" name="'+userData[i].name+'" id="'+userData[i].id+'" email="" avatar="" emailaccount="" telephone="null" onclick="selectUser(jQuery(this),true)"><span onclick="jQuery(this).prev().click();selectUser(jQuery(this).prev(),true);">'+userData[i].name+'</span></div>'
							}
							jQuery("#rightcontent").html(html);
						}else{
							jQuery("#rightcontent").html("<div class='list_div'>找不到用户</div>");
						}
					},
					error:function(XMLHttpRequest, textStatus, errorThrown){
						//alert('XMLHttpRequest.readyState-->'+XMLHttpRequest.readyState + 'XMLHttpRequest.status-->'+XMLHttpRequest.status + 'XMLHttpRequest.responseText-->'+XMLHttpRequest.responseText);
						alert("failling to visited...");
					}
				});
			}
		}

		/*获取左侧的角色列表*/
		function getRoleslist(){
			jQuery("#lefthead").html("角色列表:");
			if(rolelist!=""){
				//	if(applicationid!=""){
				jQuery.ajax({
					// url:contextPath+"/qm/getRolesList.action"+"?selectMode="+selectMode,
					url: "/obpm/api/runtime/"+qmsAppId+"/users/selectbox/role?type=0",
					type:"get",
					success:function(data){
						if(data){
							rolelist=data.data.datas;
							var html = "";
							for(var i=0;i<rolelist.length;i++){
								html += '<div id="'+rolelist[i].id+'" class="list_div" title="'+rolelist[i].name+'" onclick="getUserListByRole(jQuery(this))"><img id="img___'+rolelist[i].id+'" class="selectImg_right" src="/qms/uploads/resource/images/right_2.gif">'+rolelist[i].name+'</div>'
							}
							jQuery("#leftcontent").html(html);
						}else{
							jQuery("#leftcontent").html("<div>找不到角色</div>");
						}
					},
					error:function(data,status){
						alert("failling to visited...");
					}
				});
				//	}
			}else{
				jQuery("#leftcontent").html(rolelist);
			}
		}

		function doLeftPageNav(url){
			jQuery.ajax({
				url:contextPath+url,
				type:"post",
				datatype:"json",
				success:function(data){
					if(data){
						jQuery("#leftcontent").html(data);
					}else{
						jQuery("#leftcontent").html("<div class='list_div'>找不到用户</div>");
					}
				},
				error:function(data,status){
					alert("failling to visited...");
				}
			});
		}

		function doPageNav(url){
			jQuery.ajax({
				url:encodeURI(encodeURI(contextPath+url)),
				type:"post",
				contentType:"application/x-www-form-urlencoded:charset=UTF-8",
				datatype:"json",
				success:function(data){
					if(data){
						jQuery("#rightcontent").html(data);
					}else{
						jQuery("#rightcontent").html("<div class='list_div'>找不到用户</div>");
					}
				},
				error:function(data,status){
					alert("failling to visited...");
				}
			});
		}

		/*初始化部门树*/
		function getDeptTree() {
			jQuery("#lefthead").html("部门列表:");
			depttree = jQuery("#leftcontent").jstree({
				core:{
					initially_open: ['root']
				},
				"json_data" : {
					"ajax" : {
						"url" : function (){
							return "/obpm/api/runtime/users/selectbox/dept-tree?datetime=" + new Date().getTime();
							// return contextPath + "/qm/departTree.action?domain="+domainid+"&datetime=" + new Date().getTime();
						},
						"data" : function (node) {
							// buildParams
							var params = {};
							if (node.attr) {
								params['parentId'] = node.attr("id"); // 上级部门ID
								params['data'] = node.attr("data");
							}
							return params;
						}
					}
				},
				"plugins" : [ "themes", "json_data","lang", "ui",]
			}).bind("select_node.jstree", function(e, data){
				var node = data.rslt.obj;
				if (node && node.attr) {
					if(node.attr("id")!=""){
						var deptid=node.attr("id");
						var deptname=node.attr("name");
						//alert("deptid----->"+deptid+"    deptname--->"+deptname);
						getUserListByDept(domainid,deptid,deptname);
					}
				}
			});
		}


		/*用户点击部门节点返回该部门下的用户*/
		function getUserListByDept(domainid,deptid,deptname){
			if(domainid!="" && deptid!=""){
				jQuery("#righttitle").html("部门:"+deptname);
				jQuery.ajax({
					url: "/obpm/api/runtime/"+qmsAppId+"/users/selectbox/department?deptId="+ deptid,
					// url:contextPath+"/qm/getUserListByDept.action"+"?selectMode="+selectMode,
					success:function(data){
						if(data.errcode == 0){
							var html = "";
							var list = data.data.datas;
							for(var i=0;i<(list && list.length);i++){
								html += '<div class="list_div" title="'+list[i].name+'"><input class="list_div_click" type="checkbox" name="'+list[i].name+'" id="'+list[i].id+'" email="" avatar="" emailaccount="" telephone="'+list[i].mobile+'" onclick="selectUser(jQuery(this),true)"><span onclick="jQuery(this).prev().click();selectUser(jQuery(this).prev(),true);">'+list[i].name+'</span></div>'
							}
							jQuery("#rightcontent").html(html);
						}else{
							jQuery("#rightcontent").html("<div class='list_div'>找不到用户</div>");
						}
					},
					error:function(XMLHttpRequest, textStatus, errorThrown){
						alert("failling to visited...");
					}
				});
			}
		}
		/*根据分组id去那下面的users*/
		function getUserListByContancts(obj){
			jQuery(".selectImg_right").each(function(){
				jQuery(this).css("visibility","hidden");
			});
			// jQuery("#img_"+obj.attr("id")).css("visibility","visible");
			getUserListByContanctsid(obj);
		}

		function getUserListByContanctsid(contanctsObj){
			var contanctsid=contanctsObj.attr("id");
			var contanctsname=contanctsObj.attr("title");
			if(contanctsid!=""){
				jQuery("#righttitle").html("分组："+contanctsname);
				jQuery.ajax({
					url:contextPath+"/portal/usergroup/getUserListBycontancts.action"+"?selectMode="+selectMode,
					type:"post",
					datatype:"json",
					data:{"domainid":domainid,"contanctsid":contanctsid},
					success:function(data){
						if(data){
							jQuery("#rightcontent").html(data);
						}else{
							jQuery("#rightcontent").html("<div class='list_div'>找不到用户</div>");
						}
					},
					error:function(data,status){
						alert("failling to visited...");
					}
				});
			}
		}

		//获取左侧通讯录分组列表
		function getContancts(){
			jQuery("#lefthead").html("通讯录:");
			jQuery.ajax({
				url:contextPath+"/qm/getContancts.action"+"?selectMode="+selectMode,
				type:"post",
				datatype:"json",
				data:{"application":applicationid},
				success:function(data){
					if(data){
						rolelist=data;
						jQuery("#leftcontent").html(rolelist);
					}else{
						jQuery("#leftcontent").html("<div>找不到角色</div>");
					}
				},
				error:function(data,status){
					alert("failling to visited...");
				}
			});
		}
		function getUserListByContancts(obj){
			jQuery(".selectImg_right").each(function(){
				jQuery(this).css("visibility","hidden");
			});
			// jQuery("#img_"+obj.attr("id")).css("visibility","visible");
			getUserListByContanctsid(obj);
		}

		function getUserListByContanctsid(contanctsObj){
			var contanctsid=contanctsObj.attr("id");
			var contanctsname=contanctsObj.attr("title");
			if(contanctsid!=""){
				jQuery("#righttitle").html("分组："+contanctsname);
				jQuery.ajax({
					url:contextPath+"/qm/getUserListBycontancts.action"+"?selectMode="+selectMode,
					type:"post",
					datatype:"json",
					data:{"domainid":domainid,"contanctsid":contanctsid},
					success:function(data){
						if(data){
							//jQuery("#rightcontent").css("overflow","auto");
							jQuery("#rightcontent").html(data);
						}else{
							jQuery("#rightcontent").html("<div class='list_div'>找不到用户</div>");
						}
					},
					error:function(data,status){
						alert("failling to visited...");
					}
				});
			}
		}

		/*初始化默认值*/
		function initDefValue(defValue){
			if (defValue) {
				var array = jQuery.isArray(defValue) ? defValue: defValue.split(",");
				var params = "";
				if (array && array.length > 0) {
					for (var i = 0; i < array.length; i++) {
						params += "&_selects=" + array[i];
					}
				}

				jQuery.ajax({
					url:contextPath+"/qm/doListBySelectToJSON.action",
					type:"post",
					datatype:"json",
					data: "domain=" + domainid + params,
					success:function(userlist){
						if (userlist && userlist.length > 0) {
							for (var i = 0; i < userlist.length; i++) {
								addToUserSelectByMap(userlist[i]);
							}
						}
					},

					error:function(data,status){
						alert("failling to doListBySelectToJSON...");
					}
				});
			}
		}

		/*初始化返回事件*/
		function initDoReturnFunction(){
			jQuery("#doReturn").click(function(){
				var array = new Array();
				jQuery(".onSelect").each(function(){
					var rtn={};
					rtn.value = jQuery(this).attr("id");
					rtn.text = jQuery(this).html();
					array.push(rtn);
				});
				OBPM.dialog.doReturn(array);
			});
		}

		/*用户点击选择用户事件(返回错误信息)*/
		function selectUserWithReturnMsg(obj,isclickone){
			if(obj.attr("checked")=="checked"){
				/*jQuery(".list_div_click").each(function(){
                    if(jQuery(this).attr("id") != obj.attr("id")){
                        jQuery(this).removeAttr("checked");
                    }
                });
                jQuery("#selectedUserDiv").find("span").remove();
                return addToUserSelect(obj);*/
				addToUserSelect(obj);
			}else{
				//jQuery(this).attr("checked",false);
				jQuery(".onSelect").each(function(){
					if(jQuery(this).attr("id")==obj.attr("id")){
						jQuery("span").remove("#"+obj.attr("id"));
					}
				});
			}

			resetTargetValue();
		}

		/*用户点击选择用户事件*/
		function selectUser(obj,isclickone){
			if(obj.attr("checked")=="checked"){
				if(selectMode == 'selectOne'){
					jQuery(".list_div_click").each(function(){
						if(jQuery(this).attr("id") != obj.attr("id")){
							jQuery(this).removeAttr("checked");
						}
					});
					jQuery("#selectedUserDiv").find("span").remove();
				}
				addToUserSelect(obj);
			}else{
				//jQuery(this).attr("checked",false);
				jQuery(".onSelect").each(function(){
					if(jQuery(this).attr("id")==obj.attr("id")){
						jQuery("span").remove("#"+obj.attr("id"));
					}
				});
			}

			resetTargetValue();
		}

		function alertError(error){
			if(error){
				if(error["errorMsgBeAdd"] && error["errorMsgBeAdd"].length > 0){
					var errorMsg = error["errorMsgBeAdd"];
					errorMsg = errorMsg.substring(0,errorMsg.length - 1);
					alert("[" + errorMsg + "] {*[userAlreadyBeAdd]*}");
				}
			}
		}

		function addToUserSelect(obj){
			var map = {id: obj.attr("id"), name: obj.attr("name"), email: obj.attr("email"), telephone: obj.attr("telephone")};
			return addToUserSelectByMap(map);
		}

		function addToUserSelectByMap(map){
			var error = {};
			var errorMsgBeAdd = '';
			var id = map["id"];
			var name = map["name"];
			var email = map["email"];
			var telephone = map["telephone"];
			//var ids = document.getElementsByName(id).length;
			var ids = 1;
			jQuery("#selectedUserDiv").find("span").each(function(){
				if(jQuery(this).attr("id")==id){
					ids++;
				}
			});
			if(ids>1){
				errorMsgBeAdd += name + ';';
				//alert("{*[userAlreadyBeAdd]*}");
			}else{
				jQuery("#selectedUserDiv").append("<span style='display:block;width:95%;' onclick='clickRemoveSelect(\""+id+"\",\""+name+"\")' title='{*[Click]*}{*[Delete]*}' class='onSelect' id='"+id+"' name='"+id+"' email='"+email+"' telephone='"+telephone+"'>"+name+"</span>");
			}
			error = {"errorMsgBeAdd":errorMsgBeAdd};
			return error;
		}

		function clickRemoveSelect(id,name){
			/*
            if(jQuery("#"+id)){
                jQuery("#"+id).attr("checked",false);
            }
            if(jQuery("#"+id)){
                jQuery("span").remove("#"+id);
            }
            */
			jQuery(".list_div_click").each(function(){
				if(jQuery(this).attr("id")==id){
					jQuery(this).attr("checked",false);
					resetTargetValue();
				}
			});
			/*
            jQuery(".onSelect").each(function(){
                if(jQuery(this).attr("id")==id){
                    jQuery("span").remove("#"+jQuery(this).attr("id"));
                }
            });
            */

			jQuery('span[class=onSelect]').live('click',function(){
				jQuery(this).remove();
				resetTargetValue();
			});
			resetTargetValue();
			jQuery("#selectedUserDiv").focus();
		}

		/* 设置值到目标文本框中 */
		function resetTargetValue(){
			var targetValue="";
			var names="";
			var emails="";
			var telephones="";
			jQuery(".onSelect").each(function(){
				targetValue+=jQuery(this).attr("id")+";";//多个用户用“;”分隔
				names+=jQuery(this).html()+";";
				emails+=jQuery(this).attr("email")+";";
				telephones+=jQuery(this).attr("telephone")+";";
			});
			targetValue=targetValue.substring(0,targetValue.length-1);
			names=names.substring(0,names.length-1);
			emails=emails.substring(0,emails.length-1);
			telephones=telephones.substring(0,telephones.length-1);
			//parentObj.document.getElementsByName(targetid)[0].value=targetValue;
			if (parentObj.document.getElementById(targetid)) {
				parentObj.document.getElementById(targetid).value=targetValue;
			}
			if (parentObj.document.getElementById(viewName)) {
				parentObj.document.getElementById(viewName).value=names;
				parentObj.document.getElementById(viewName).title=bulitTitle(names);
			}
			if (parentObj.document.getElementById(viewEmail)) {
				parentObj.document.getElementById(viewEmail).value=emails;
			}
			if (parentObj.document.getElementById(viewTelephone)) {
				parentObj.document.getElementById(viewTelephone).value=telephones;
			}
			//parentObj.findUserName(targetValue);
		}

		function bulitTitle(names){
			if(names != null && names != ''){
				var array = names.split(";");
				var title = '';
				for(var i = 0; i < array.length; i++){
					if(i != 0 && i%10 == 0){
						title += "\n";
					}
					title += array[i] + ";";
				}
				return title == ''?title:title.substring(0,title.length-1);
			}
			return '';
		}

		//设置己选择的用户数据
		function initSetValue(){
			var targetidVal = "";
			var viewNameVal = "";
			if (parentObj.document.getElementById(targetid)) {
				targetidVal = parentObj.document.getElementById(targetid).value;
			}
			if (parentObj.document.getElementById(viewName)) {
				viewNameVal = parentObj.document.getElementById(viewName).value;
			}
			var userIds = targetidVal.split(";");
			var userNames = viewNameVal.split(";");
			for(var i=0; i<userIds.length; i++){
				if(userIds[i] != ""){
					var obj = {id:userIds[i],name:userNames[i],email:'',telephone:''};
					addToUserSelectByMap(obj);
				}
			}
		}
		//滚动条
		function rightContentScroll(){
			var rightscrollHeight = jQuery(".crossULdivright_lef").height()-jQuery(".crossULdivright_lef>#right_btn").height()-jQuery(".crossULdivright_lef>#righttitle").height()-2;
			var leftscrollHeight = jQuery(".crossULdivleft").height()-jQuery(".crossULdivleft>#lefthead").height()-2;
			var selectedscrollHeight = jQuery(".crossULdivright_rig").height()-jQuery(".crossULdivright_rig>.list_div_head").height()-2;
			$("#rightcontent").slimscroll({
				height: rightscrollHeight,
				color:'#333'
			});
			$("#leftcontent").slimscroll({
				height: leftscrollHeight,
				color:'#333'
			});
			$("#selectedUserDiv").slimscroll({
				height: selectedscrollHeight,
				color:'#333'
			});
		}
		jQuery(document).ready(function(){
			getRoleslist();
			//getDeptTree();
			initDoReturnFunction();
			initDefValue(defValue);
			initSetValue();
			//OBPM.dialog.resize(jQuery(window).width()+20, jQuery(window).height()+75);

			jQuery("#addAll").click(function(){
				jQuery(".list_div_click").each(function(){
					jQuery(this).attr("checked",true);
					addToUserSelect(jQuery(this));
				});
				/**var errorMsgBeAdd = '';
				 jQuery("#rightcontent").find('input[class=list_div_click]').each(function(){
				var error = selectUserWithReturnMsg(jQuery(this),false);
				if(error){
					if(error["errorMsgBeAdd"] && error["errorMsgBeAdd"].length > 0){
						errorMsgBeAdd += error["errorMsgBeAdd"];
					}
				}
			});
				 if(errorMsgBeAdd && errorMsgBeAdd.length > 0){
				errorMsgBeAdd = errorMsgBeAdd.substring(0,errorMsgBeAdd.length - 1);
				alert("[" + errorMsgBeAdd + "] {*[userAlreadyBeAdd]*}");
			}**/
				resetTargetValue();
			});


			jQuery("#deleteAll").click(function(){
				jQuery(".list_div_click").each(function(){
					jQuery(this).attr("checked",false);
				});
				jQuery("#selectedUserDiv").html("");
				resetTargetValue();
			});

			/*注册页签切换事件*/
			jQuery(".crossUL > li").click(function(){
				if(jQuery(this).index() == $(".crossUL li").length - 1){
					jQuery(".guideOne").css("display","none");
					jQuery("#left").css("display","none");
					jQuery("#right_btn").css("display","none");
					jQuery(".crossULdivright_lef").css({"width":"423px"});
					jQuery(".crossULdivright_lef>.slimScrollDiv").css({"height":"330px"});
					jQuery(".crossULdivright_lef>.slimScrollDiv>#rightcontent").css({"height":"330px"});
				}else{
					jQuery(".guideOne").css("display","block");
					jQuery(".crossULdivright_lef").css("display","block");
					jQuery("#righttitle").html('');
					jQuery("#left").css("display","block");
					if(selectMode != 'selectOne'){
						jQuery("#right_btn").css("display","block");
					}
					jQuery(".crossULdivright_lef").css({"width":"198px"});
					jQuery(".crossULdivright_lef>.slimScrollDiv").css({"height":"292px"});
					jQuery(".crossULdivright_lef>.slimScrollDiv>#rightcontent").css({"height":"292px"});
				}
				jQuery(".crossUL li.on").removeClass("on");
				jQuery(this).addClass("on");
				$("#rightcontent").html("");
				if(jQuery(this).attr("id")=="bydept"){
					getDeptTree();
				}
				if(jQuery(this).attr("id")=="byroles"){
					getRoleslist();
				}
				if(jQuery(this).attr("id")=="byonline"){
					getOnLineUserList();
				}
				if(jQuery(this).attr("id")=="bycontancts"){
					getContancts();
				}
				if(jQuery(this).attr("id")=="bysearch"){
					getAllUser("");
				}
			});

			if(selectMode == 'selectOne'){
				document.getElementById("addAll").parentNode.style.display = "none";
			}
			//滚动条
			rightContentScroll();
		});
	</script>
</head>
<body style="overflow-x:hidden;overflow-y:hidden;height:100%;margin: 0;">

<div class="crossUL-top">
	<ul class="crossUL">
		<li id="byroles" class="on">按角色</li>
		<li id="bydept">按部门</li>
		
		
		<li id="bysearch">查询</li>
	</ul>
</div>
<div style="float:none;clear:both;"></div>
<div class="contentDiv on">
	<div id="left" class="crossULdivleft">
		<div id="lefthead" class="list_div list_div_head"></div>
		<div id="leftcontent" class="leftContent" style="overflow-x:hidden;height:320px"></div>
	</div>

	<div id="right" class="crossULdivright">
		<div class="guide guideOne"></div>
		<div class="crossULdivright_lef">
			<div id="right_btn" class="list_div list_div_head" style="text-align:center;">
				<input id="addAll" type="button" class="btn btn-default" value="添加本页所有">
			</div>
			<div id="righttitle" style="height: 38px;line-height:38px;padding-left:10px;color:#676a6c;background-color: #fafafa;border-bottom: 1px solid #d2d2d2;"></div>
			<div id="rightcontent" style="clear: all;"></div>
		</div>
		<div class="guide"></div>
		<div class="crossULdivright_rig">
			<div class="list_div list_div_head">
				已选择用户:
			</div>

			<div id="selectedUserDiv" class="selectedUserDiv"></div>
			<div style="margin-right:10px;position: absolute;top: 2px;right: 0;"><input id="deleteAll" class="btn btn-danger" type="button" value="清除所有"></div>
		</div>
	</div>
	<div style="float:none;clear:both;"></div>
</div>
<div style="float:none;clear:both;"></div>
<div style="float: right;padding: 0 20px;margin-top:17px;">
	<input id="doReturn" class="btn btn-success" type="button" value="确认">
</div>
</body>
</html>
